#include<stdio.h>
#include<stdlib.h>

#define eleType int

typedef struct Node
{
    eleType data;
    struct Node *next;

} Node ;

typedef struct {
    Node *front;
    Node *rear;
    size_t size;


}Queque;

void QueueCreate(Queque *q){
    q->front = q->rear = NULL;
    q->size = 0;
}

void QueueDestroy(Queque *q){
    while(q->front){
        Node *p = q->front;
        q->front = q->front->next;
        free(p);
        
    }
    q->rear = NULL;
    q->size = 0;
}

// 入队
void QueuePush(Queque *q,eleType element){
    Node *newNode = (Node *)malloc(sizeof(Node));
    newNode->data = element; 
    newNode->next = NULL;

    if(q->front == NULL){
        q->front = q->rear = newNode;
    }else{
        q->rear->next = newNode;
        q->rear = newNode;

    }
    q->size++;
}